﻿using System;
using System.Windows.Forms;
using Autodesk.Revit.DB.Mechanical;

namespace YArchitech.HYSpace.SpaceManager.Manager
{
	internal class SpaceNodeEx : TreeNode
	{
		public SpaceNodeEx(Space space) : base(space.Name)
		{
			this.m_space = space;
			string[] array = space.Name.Split(new char[]
			{
				' '
			});
			if (array.Length == 2)
			{
				base.Text = array[1] + " " + array[0];
			}
			else
			{
				base.Text = space.Name;
			}
			if (space.Zone != null)
			{
				base.Text = base.Text + "[" + space.Zone.Name + "]";
				return;
			}
			base.Text += "[默认]";
		}

		public Space Space
		{
			get
			{
				return this.m_space;
			}
		}

		private Space m_space;
	}
}
